< previous page page_111 next page >

Page 111
then must enter additional data to complete the process. For example, if the user indicates on a form that the customer requests all products to be shipped instead of picked up, input validation should make sure that valid data has been entered into the shipping address fields. Another example of conditional field validation is when entering a value in one field requires that the value in another field be within a certain range. For example, if the customer's credit limit is above $50,000, you must enter a valid credit-worthiness code of 5 or above. In this case, the two fields must be checked against one another and verified before the user can save the record to the database.
As you can see from the preceding examples, input validation is more than just making sure the data entered in a field is correct. Input validation should be viewed as a set of rules to ensure that quality data is entered into the system. Before you begin writing your data entry forms, you should spend time developing a comprehensive set of validation rules. Once you develop these rules, you are ready to start creating your data entry form.
Common Input Validation Rules
Almost every field in your database requires some type of input validation. Before you design your form, put together a list of all the fields you need on the form and answer the following questions for each input field:
· Must data be entered in the field? (Is it a required field?)
· What characters are valid/invalid for this field? (Numeric input only, capital letters only, no spaces allowed, and so on.)
· For numeric fields, is there a high/low range limit? (Must be greater than zero and less than 1000, can't be less than 100, and so on.)
· Is there a list of valid values for this field? (Can user enter only Retail, Wholesale, or Other; Name must already be in the Customer table, and so on.)
· Is this a conditional field? (If users enter Yes in field A, they must enter something in field C.)
Even though each data entry form is unique, you can use some general guidelines when putting together input validation schemes.
· If possible, limit keystrokes to valid values only. For example, if the field must be numeric, don't allow the user to enter character values. If spaces are not allowed, make sure the space bar is disabled. Help the user by limiting the kinds of data that can be entered into the field.
· Limit input choices with lists. If there is a limited set of valid inputs for a field, give the user a pick list or set of radio buttons to choose from.

 
< previous page page_111 next page >

If you like this book, buy it!